/*
 * @Description:
 * @Version:
 * @Author: Troubadour
 * @Date: 2022-09-11 22:21:09
 * @LastEditors: Troubadour
 * @LastEditTime: 2022-09-12 08:22:11
 */

#ifndef __OLED_H
#define __OLED_H

#include "main.h"
#include "myiic.h"

//--------------OLED参数定义---------------------
#define PAGE_SIZE    8
#define XLevelL		 0x00
#define XLevelH		 0x10
#define YLevel       0xB0
#define	Brightness	 0xDF
#define WIDTH 	     128
#define HEIGHT 	     64
//定义IIC从设备地址
#define IIC_SLAVE_ADDR 0x78

//-------------写命令和数据定义-------------------
#define OLED_CMD     0	//写命令
#define OLED_DATA    1	//写数据

//OLED控制用函数
void OLED_WR_Byte(unsigned dat,unsigned cmd);
void OLED_Display_On(void);
void OLED_Display_Off(void);
void OLED_Set_Pos(unsigned char x, unsigned char y);
void OLED_Init_GPIO(void);
void OLED_Init(void);
void OLED_Set_Pixel(unsigned char x, unsigned char y,unsigned char color);
void OLED_Display(void);
void OLED_Clear(unsigned dat);
#endif
